<script setup>
defineProps({
  title: String,
  value: [Number, String],
  unit: String,
  icon: String
})
</script>

<template>
  <div class="health-card">
    <div class="card-header">
      <div class="icon-container" :class="`${title.toLowerCase()}-icon`">
        <span class="material-icons">{{ icon }}</span>
      </div>
      <h3>{{ title }}</h3>
    </div>
    <div class="card-value">
      <span class="value">{{ value }}</span>
      <span class="unit">{{ unit }}</span>
    </div>
  </div>
</template>

<style scoped>
.health-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.health-card:hover {
  transform: translateY(-5px);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.icon-container {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.exercise-icon { background: rgba(76, 175, 80, 0.15); color: #4CAF50; }
.diet-icon { background: rgba(255, 152, 0, 0.15); color: #FF9800; }
.sleep-icon { background: rgba(33, 150, 243, 0.15); color: #2196F3; }

.card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.card-value {
  display: flex;
  align-items: baseline;
}

.value {
  font-size: 32px;
  font-weight: 700;
  margin-right: 8px;
  color: #2c3e50;
}

.unit {
  font-size: 16px;
  color: #7f8c8d;
}
</style>